<?php

include_once './function/function.php';

////递归数据输出文件目录，有时间在写
//function recursive_directory_array($array = []) {
//    
//}

$dir_arraty = recursive_directory();
//pp($dir_arraty);

$html = '';
$html .= "<ul>";
foreach ($dir_arraty as $k => $v) {
    if (empty($v['is_dir'])) {
        $html .= "<li><a href = '{$v['name']}' target='_blank'>{$v['name']}</a></li>";
    } else {
        $html .= "<li>Directory：{$v['name']}<ul>";
        foreach ($v['child'] as $kk => $vv) {
            $html .= "<li>File：<a href = '{$v['name']}/{$vv['name']}' target='_blank'>{$vv['name']}</a></li>";
        }
        $html .= "</ul></li>";
    }
}
$html .= "</ul>";
echo $html;
?>

